//
//  CapriceMusicPlayer.m
//  CapriceMusic
//
//  Created by 蒋恩浩 on 16/1/16.
//  Copyright © 2016年 MYX. All rights reserved.
//

#import "CapriceMusicPlayer.h"

@implementation CapriceMusicPlayer

+ (CapriceMusicPlayer *)sharePlayer{
    
    static CapriceMusicPlayer* player = nil;
    if (player == nil) {
        
        player = [[CapriceMusicPlayer alloc] init];
    }
    return player;
}

- (void)playWithURL:(NSString *)url{
    
    AVPlayerItem * item = [[AVPlayerItem alloc] initWithURL:[NSURL URLWithString:url]];
    [self replaceCurrentItemWithPlayerItem:item];
    [self play];
}

@end
